0

I've created my own adminhtml grid for a module and was wondering if somebody could point out how I can adjust the width of the whole grid itself? (I.E to only utilize 80% of the page width).

Please note that I am not asking how to change the column width, but the % of the page that the grid's width will occupy.

Thanks in advance.

P.S I've got a feeling it will be in the Grid.php file?

class Namespace_Module_Block_Adminhtml_Custom_Grid extends Mage_Adminhtml_Block_Widget_Grid


public function __construct(){
parent::__construct();
#Somewhere here?
}

Keyul Shah
7,22913 gold badges38 silver badges60 bronze badges
asked Nov 20, 2013 at 13:39

1 Answer 1

0

You can do that from css.
Add to your grid page a custom css file with this line:

#ID_OF_GRID {width:80%}

Use firebug, or view source to see the value for ID_OF_GRID.
Usually the id is the value you set in the grid constructor using:

$this->setId('...');
answered Nov 20, 2013 at 13:47
1
  • Thanks, excellent solution. Could you please indicate to me what your preferred way of adding custom css? I went the route of <action method="addCSS"> in the layout.xml file of mine. Commented Nov 20, 2013 at 14:51

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.